home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-09-10 | 6.1 KB | 191 lines | [TEXT/MPS ] |
- (*+
- * File: UVUAssist.p
- *
- * Contains: VU Assistance class - MacApp 3.0b2PQR compatible version
- *
- * Written by: David Shayer
- *
- * Copyright: © 1991 by Apple Computer, Inc., all rights reserved.
- *
- * Version: 1.0d10
- *
- * 9/10/91 JAS indicate 3.0b2PQR compatibility, change version
- * 8/21/91 JAS change version
- * 8/20/91 JAS remove debugging code
- * 8/19/91 JAS rev comments and change case of GridItemSupport to
- * gridItemSupport
- * 8/16/91 JAS change interfaces for 3.0b2PQR
- * 8/15/91 JAS remove unneeded interfaces
- * 8/15/91 JAS add fGridItemSupport data member to TVUAssist and change
- * prototype of IVUAssist to take GridItemSupport as input
- * 8/13/91 JAS include gridItem parameter in FillDlogItemDesc and RankToItem
- * 8/13/91 JAS make TGridItem direct descendant of TObject instead of
- * TGridView
- * 8/6/91 JAS remove TVUAssist.DoFindWindowInfo (not needed)
- -*)
-
-
- {Historical Note: References to the "Mole" are equivalent to references to "Agent VU".
- "Agent VU" was previously called the "Mole".}
-
- (*
-
- So you wanna use V.U. to test your MacApp program? You need to help Agent VU find things
- in your windows, since MacApp views appear empty to Agent VU. Fortunately, Agent VU has a
- hook for an assistance procedure. The assistance procedure is a routine, in the application
- being manipulated by V.U., that feeds Agent VU inside information about what's in the
- views. This unit implements that assistance routine.
-
- This unit contains 4 files: VUAssist.p, VUAssist.inc1.p, VUAssist.inc2.p,
- and VUAssist.a.
-
- See the "READ ME FIRST!" file for instructions on how to use VUAssist and other information.
-
- *)
-
-
- UNIT UVUAssist;
-
- INTERFACE
-
- USES
-
- Types, MacAppTypes, Memory, UPascalObject, UObject, UList, AppleEvents, UEvent,
- UCommand, Dialogs, UEventHandler, UCommandHandler, UApplication, Balloons, UAdorners,
- UStream, UView, UWindow, UBehavior, UViewBehavior, UPrintHandler, UFailure,
- UGeometry, OSUtils, Menus, UMenuMgr,
-
- { • Building Blocks }
- PrintTraps, UPrinting, UGridView, UTEView, UControl, UDialog, UPopup,
-
- { • System Interfaces }
- Errors,
- Resources,
- AppleTalk, ToolUtils,
- OSEvents,
- Packages,
- Devices,
- Script;
-
-
- {$I UVUAssist.inc1.p}
-
- TYPE
-
- TGridItem = OBJECT (TObject)
-
- fGridView: TGridView; { reference to a TGridView object}
-
- fColumn: longint; { 1 based counter }
-
- fRow: longint; { 1 based counter }
-
- fRank: longint; { (row-1) * rowlength + column }
-
- PROCEDURE TGridItem.IGridItem(theGridView: TGridView; Rank: integer);
-
- PROCEDURE TGridItem.GetExtent(VAR itsExtent: VRect);
-
- PROCEDURE TGridItem.LocalToWindow(VAR thePoint: VPoint);
-
- END;
-
-
- { There is a another definition of this object in UVUAssist.a, which is
- a subset of this definition. If you update this definition, be sure to
- update the one in UVUAssist.a, if necessary. }
- TVUAssist = OBJECT (TEventHandler)
-
- fMoleRefNum :integer;
-
- fGridItemSupport :boolean;
-
- PROCEDURE TVUAssist.IVUAssist(gridItemSupport: boolean);
-
- PROCEDURE TVUAssist.OpenMoleDriver;
-
- PROCEDURE TVUAssist.SuspendMole;
-
- PROCEDURE TVUAssist.ResumeMole;
-
- PROCEDURE TVUAssist.SetDebuggerHook (NewHook :ProcPtr);
-
- FUNCTION TVUAssist.MoleAssist (Select :integer; Input :Ptr; Output :Ptr;
- VAR OutputSize :integer; IntResult :integer) :integer;
-
- FUNCTION TVUAssist.DoMenuInfo (Input :Ptr; Output :Ptr; VAR OutputSize :integer;
- Result :MoleError) :MoleError;
-
- FUNCTION TVUAssist.DoMenuItems (Input :Ptr; Output :Ptr; VAR OutputSize :integer;
- Result :MoleError) :MoleError;
-
- FUNCTION TVUAssist.DoSendWindowInfo (Input :Ptr; Output :Ptr;
- VAR OutputSize :integer; Result :MoleError) :MoleError;
-
- FUNCTION TVUAssist.DoFindControl (Input :Ptr; Output :Ptr;
- VAR OutputSize :integer; Result :MoleError) :MoleError;
-
- FUNCTION TVUAssist.DoSendControlInfo (Input :Ptr; Output :Ptr;
- VAR OutputSize :integer; Result :MoleError) :MoleError;
-
- FUNCTION TVUAssist.DoSendDlogItemInfo (Input :Ptr; Output :Ptr;
- VAR OutputSize :integer; Result :MoleError) :MoleError;
-
- PROCEDURE TVUAssist.FillPopupDesc (Popup: TPopup; MenuRank: integer;
- MenuDescPtr :MoleMenuInfoPtr; VAR OutputSize :integer);
-
- FUNCTION TVUAssist.FillPopupItemDesc (Popup: TPopup; MenuRank: integer;
- start: integer; stop: integer; MenuItemDescPtr :MoleDataBlockPtr;
- VAR OutputSize :integer) :MoleError;
-
- FUNCTION TVUAssist.FillCtrlDesc (CtrlDescPtr :MoleCDescPtr; thePart :integer;
- WindRank :integer; ControlRank :integer; Control :TControl;
- VAR OutputSize :integer): Boolean;
-
- PROCEDURE TVUAssist.ViewRectToWindowRect (VAR aRect :Rect; aView :TView);
-
- PROCEDURE TVUAssist.FillDlogItemDesc (DlogDescPtr :MoleDItemInfoPtr;
- Window :TWindow; WindRank :integer; ItemRank :integer; Item :TView;
- VAR OutputSize :integer; gridItem :TGridItem );
-
- FUNCTION TVUAssist.RankToWindow (Rank :integer) :TWindow;
-
- FUNCTION TVUAssist.WindowToRank (WindToFind :WindowPeek) :integer;
-
- PROCEDURE TVUAssist.GlobalToWindow (Window :TWindow; Pt :Point; VAR VPt :VPoint);
-
- PROCEDURE TVUAssist.WindowToView (View :TView; VAR VPt :VPoint; VAR Pt :Point);
-
- FUNCTION TVUAssist.MenuIDToPopup (MenuID :integer) :TPopup;
-
- FUNCTION TVUAssist.PointToControl (Window :TWindow; Pt :Point;
- VAR Rank :integer) :TCtlMgr;
-
- FUNCTION TVUAssist.ItemToRank (Window :TWindow; View :TView;
- DlogViewItems :Boolean) :integer;
-
- FUNCTION TVUAssist.RankToItem (Window :TWindow; Rank :integer;
- DlogViewItems :Boolean; VAR gridItem: TGridItem ) :TView;
-
- FUNCTION TVUAssist.ViewCount (Window :TWindow; DlogViewItems :Boolean) :integer;
-
- FUNCTION TVUAssist.CountGridItems (theGridView: TGridView): integer;
-
- FUNCTION TVUAssist.GetItemType (Item :TView; DlogViewItems :Boolean;
- GridViewItems: Boolean) :ViewItems;
-
-
- END;
-
-
- VAR
- gVUAssist : TVUAssist; { the mole assist proc }
-
-
- IMPLEMENTATION
-
- {$I UVUAssist.inc2.p}
-
-
- END.
-